package com.learning.javaweb_springboot_page_query.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.learning.javaweb_springboot_page_query.entity.Order;
import com.learning.javaweb_springboot_page_query.entity.User;
import com.learning.javaweb_springboot_page_query.mapper.OrderMapper;
import com.learning.javaweb_springboot_page_query.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    OrderMapper orderMapper;

//    通过id获取订单
    @Override
    public Order queryOrderById(Integer id) {
        return orderMapper.selectByid(id);
    }

    // 通过uid获取订单列表
    public List<Order> getOrdersByUid(int uid) {
        return orderMapper.selectByUid(uid);
    }
}
